package com.tepth.vehiclemaintenance.mvp.work.content;

import com.tepth.vehiclemaintenance.base.BaseModel;
import com.tepth.vehiclemaintenance.base.BasePresenter;
import com.tepth.vehiclemaintenance.base.BaseView;
import com.tepth.vehiclemaintenance.bean.MaintainDriverRemark;
import com.tepth.vehiclemaintenance.bean.MaintainListWork;
import com.tepth.vehiclemaintenance.net.ApiModel;

import java.util.ArrayList;

import io.reactivex.Observable;

/**
 * Created by zhangyu on 2017/5/11.
 */

public class ContentContract {

    interface View extends BaseView {
        String getAuthKey();

        String getWorkContentsJson();

        String getConfirmJson();

        String getCompleteRemark();

        int getMaintenanceId();

        void showDriverRemarkList(ArrayList<MaintainDriverRemark> list);

        void showMaintainListWork(ArrayList<MaintainListWork> list);

        void onLoadTagDataError(String msg);

        void onLoadWorkListDataError(String msg);
        void onPunchCardSucceed();
    }

    interface Model extends BaseModel {
        Observable<ApiModel<ArrayList<MaintainDriverRemark>>> getDriverRemark(String authKey,
                                                                              int maintenanceId);

        Observable<ApiModel<ArrayList<MaintainListWork>>> getMaintainListWork(String authKey,
                                                                              int maintenanceId);

        Observable<ApiModel<String>> punchCard(String authKey,
                                               int maintenanceId,
                                               String workContentsJson,
                                               String confirmJson,
                                               String completedRemark);
    }

    abstract static class Presenter extends BasePresenter<Model, View> {

        @Override
        public void onStart() {

        }

        abstract void getDriverRemark();

        abstract void getMaintainListWork();

        abstract void punchCard();
    }
}